package com.example.mode.factoryMode.simpleFactoryMode;

import com.example.mode.factoryMode.Human;

/**
 * Created with IntelliJ IDEA.
 * User: yf-wenhao
 * Date: 2019/3/26
 * Time: 下午3:33
 * 创建工厂类
 */
public class Factory {

    public static  <T extends Human> T create(Class<T> tClass) {
        try {
            return tClass.newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

}
